using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Indexes
{
    /// <summary>
    /// <para>Add Attribute Index</para>
    /// <para>Adds an attribute index to an existing table, feature class, shapefile, or attributed relationship class.</para>
    /// <para>将属性索引添加到现有表、要素类、shapefile 或属性关系类。</para>
    /// </summary>    
    [DisplayName("Add Attribute Index")]
    public class AddIndex : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddIndex()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The table containing the fields to be indexed.</para>
        /// <para>包含要编制索引的字段的表。</para>
        /// </param>
        /// <param name="_fields">
        /// <para>Fields to Index</para>
        /// <para>The list of fields that will participate in the index. Any number of fields can be specified.</para>
        /// <para>将参与索引的字段列表。可以指定任意数量的字段。</para>
        /// </param>
        public AddIndex(object _in_table, List<object> _fields)
        {
            this._in_table = _in_table;
            this._fields = _fields;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Add Attribute Index";

        public override string CallName => "management.AddIndex";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _fields, _index_name, _unique.GetGPValue(), _ascending.GetGPValue(), _out_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The table containing the fields to be indexed.</para>
        /// <para>包含要编制索引的字段的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Fields to Index</para>
        /// <para>The list of fields that will participate in the index. Any number of fields can be specified.</para>
        /// <para>将参与索引的字段列表。可以指定任意数量的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fields to Index")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _fields { get; set; }


        /// <summary>
        /// <para>Index Name</para>
        /// <para>The name of the new index. An index name is necessary when adding an index to geodatabase feature classes and tables. For other types of input, the name is ignored.</para>
        /// <para>新索引的名称。向地理数据库要素类和表添加索引时，索引名称是必需的。对于其他类型的输入，将忽略该名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Index Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _index_name { get; set; } = null;


        /// <summary>
        /// <para>Unique</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the values in the index are unique.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—All values in the index are not unique. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—All values in the index are unique.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定索引中的值是否唯一。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 索引中的所有值都不是唯一的。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 索引中的所有值都是唯一的。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Unique")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _unique_value _unique { get; set; } = _unique_value._false;

        public enum _unique_value
        {
            /// <summary>
            /// <para>UNIQUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("UNIQUE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_UNIQUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_UNIQUE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Ascending</para>
        /// <para><xdoc>
        ///   <para>Specifies whether values are indexed in ascending order.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Values are not indexed in ascending order. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Values are indexed in ascending order.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否按升序对值编制索引。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不按升序对值进行索引。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 按升序对值进行索引。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ascending")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ascending_value _ascending { get; set; } = _ascending_value._false;

        public enum _ascending_value
        {
            /// <summary>
            /// <para>ASCENDING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ASCENDING")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_ASCENDING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_ASCENDING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        public AddIndex SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}